package com.bwie.service.impl;

import cn.hutool.core.util.StrUtil;
import com.bwie.common.domain.Gift;
import com.bwie.mapper.GiftMapper;
import com.bwie.service.GiftService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class GiftServiceImpl implements GiftService {

    @Autowired
    private GiftMapper giftMapper;

    @Override
    public void add(Gift gift) {
        String giftName = gift.getGiftName();
        if(StrUtil.isBlank(giftName)){
            throw new RuntimeException("奖品名称不能为空");
        }
        giftMapper.add(gift);
    }
}
